package ui;

import java.awt.Container;

import javax.swing.JDialog;
import javax.swing.JPanel;

public class ControladorTelas {

        private Container con = null;
        private JDialog jdg = null;

        public void exibirTela(String titulo, JPanel conteudo, String icone,int largura, int altura){
                con = new JDialog(TelaPrincipal.getInstance());
                jdg = (JDialog) con;
                jdg.setTitle(titulo);
                jdg.add(conteudo);
                jdg.pack();
                //jdg.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/h1/sismetro/gui/imagens/"+icone)));
                jdg.setSize(largura + 15, altura + 40);
                jdg.setResizable(false);
                jdg.setVisible(true);
        }

        public void fecharTela(){
                if(jdg.isShowing())
                        jdg.dispose();
        }
}

